import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "../views/home/Index"
import My from "../views/my/My";

import Login from "../views/login/Login";

import Searchindex from "../views/Search/Searchindex";
import Searchresults from "../views/Search/Searchresults";
import Allcourses from "../views/Search/Allcourses";
import Allusers from "../views/Search/Allusers";
import Users from "../views/Search/Users";



import DynIndex from "../views/dynamicPag/DynIndex"
import DynamicPag from "../views/dynamicPag/DynamicPag";

Vue.use(VueRouter)

const routes = [
    {
        path: '*',
        component: () => import("../views/Page404")
    },
    
    {path:'/search/index',component:Searchindex},
    {path:'/search/result',component:Searchresults},
    {path:'/search/allcourses',component:Allcourses},
    {path:'/search/allusers',component:Allusers},
    {path:'/search/users',component:Users},
    {path:'/search/index',component:()=>import("../views/Search/Searchindex")},
    {path:'/search/result',component:()=>import("../views/Search/Searchresults")},
    {path:'/search/allcourses',component:()=>import("../views/Search/Allcourses")},
    {path:'/search/searchNoResults',component:()=>import("../views/Search/SearchNoresults")},
    {path: '/search/index', component: Searchindex},
    {path: '/search/result', component: Searchresults},
    {path: '/search/allcourses', component: Allcourses},
    {path: '/search/allusers', component: Allusers},
    {path: '/search/index', component: () => import("../views/Search/Searchindex")},
    {path: '/search/result', component: () => import("../views/Search/Searchresults")},
    {path: '/search/allcourses', component: () => import("../views/Search/Allcourses")},

    {path: '/pay/error', component: () => import("../views/Pay/Payerror")},
    {path: '/pay/index', component: () => import("../views/Pay/PayIndex")},
    {path: '/pay/success', component: () => import("../views/Pay/Paysuccess")},

    {
        path: '/find',
        component: () => import('../views/find/Find')
    },
    {
        path:'/allCourse',
      component:()=>import('../views/find/AllCourse')
    },
    {
        path:'/brief',
      component:()=>import('../views/find/Brief')
    },
    {
        path:'/dynIndex',
        component:DynIndex,
        redirect:'/dynIndex/dynamicPag',
        children:[
            {path:'dynamicPag',component:DynamicPag},
            {path:'near',
            component:()=>import('../views/dynamicPag/Near')
        },
            {path:'attenPag',
            component:()=>import('../views/dynamicPag/AttenPag')
        }
            ]
    },
    {
            path:'/newDyn',
            component:()=>import('../views/dynamicPag/newDyn')
        },
    {
        path: '/',
        component: Login,
    },
    {
      path:'/one',
        component:()=>import('../views/login/Step2')
    },
    {
        path:'/two',
        component:()=>import('../views/login/Step1')
    },
    {
        path:'/three',
        component:()=>import('../views/login/Step3')
    },
    {
        path: '/index',
        name: 'index',
        component: Index,
        redirect: 'my',
        children: [
            // {path: 'pay/error', component: () => import("../views/Pay/Payerror")},
            // {path: 'pay/index', component: () => import("../views/Pay/PayIndex")},
            // {path: 'pay/success', component: () => import("../views/Pay/Paysuccess")},


            {path: 'my/save', component: () => import("../views/my/save/Save")},

            {path: 'my/plan', component: () => import("../views/my/Plan/Plan")},

            {path: 'my/fans', component: () => import("../views/my/fans/Fans")},

            {path: 'my/moveCareer', component: () => import('../views/my/moveCareer/MoveCareer')},

            {path: 'my/dynamic', component: () => import("../views/my/dynamic/Dynamic")},

            {path: 'my/attention', component: () => import( "../views/my/attention/Attention")},

            {path: 'my/order', component: () => import("../views/my/order/Order")},


            {path: 'my/device', component: () => import("../views/my/device/Device")},

            {path: 'my/setting/setting', component: () => import("../views/my/Setting/Setting")},
            {path: 'my/setting/invite', component: () => import("../views/my/Setting/Invite")},
            {path: 'my/setting/message', component: () => import("../views/my/Setting/Message")},
            {path: 'my/setting/password', component: () => import("../views/my/Setting/PassWordChange")},
            {path: 'my/setting/phone', component: () => import("../views/my/Setting/PhoneChange")},
            {path: 'my/setting/state', component: () => import("../views/my/Setting/State")},
            {path: 'my/setting/suggest', component: () => import("../views/my/Setting/Suggest")},
            {path: 'my/setting/about', component: () => import("../views/my/Setting/About")},


            {path:'my',component:My},
            {path:'my/myCourse',component:()=>import("../views/my/MyCourse")},
            {path:'my/postCourse',component:()=>import("../views/my/PostCourse")},
            {path:'my/money',component:()=>import("../views/my/Wallet/Money")},


            {path:'information/private-letter',component:()=>import("../views/information/private-letter")},
            {path:'information/notice',component:()=>import("../views/information/notice")},
            {path:'information/information',component:()=>import("../views/information/information")},
            {path:'motion/motion',component:()=>import("../views/motion/motion")},
            {path:'motion/motion-plan',component:()=>import("../views/motion/motion-plan")},

            {path: 'my', component: My},
            {path: 'my/myCourse', component: () => import("../views/my/MyCourse")},
            {path: 'my/postCourse', component: () => import("../views/my/PostCourse")},
            {path: 'my/money', component: () => import("../views/my/Wallet/Money")},

        ]
    },]


const router = new VueRouter({
    routes,
    linkActiveClass: 'active',
    mode: 'history'
})

export default router
